package com.gravity.client;

import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.ImageBundle;
import com.google.gwt.user.client.ui.TreeImages;

public abstract class Sink extends Composite {

  public interface Images extends ImageBundle, TreeImages {
    AbstractImagePrototype gwtLogo();
  }

  public abstract static class SinkInfo {
    private Sink instance;
    private String name, description;

    public SinkInfo(String name, String desc) {
      this.name = name;
      description = desc;
    }

    public abstract Sink createInstance();

    public String getColor() {
      return "#2a8ebf";
    }

    public String getDescription() {
      return description;
    }

    public final Sink getInstance() {
      if (instance != null) {
        return instance;
      }
      return (instance = createInstance());
    }

    public String getName() {
      return name;
    }
  }

  /**
   * Called just before this sink is hidden.
   */
  public void onHide() {
  }

  /**
   * Called just after this sink is shown.
   */
  public void onShow() {
  }
}
